ImageMagik’s convert
will merge multiple PDFs into a single file:
convert file1.pdf file2.pdf file3.pdf outputfile.pdf
H/T Sagar Sharma @ https://learnubuntu.com/merge-pdf-files/
Like the author, I had to change ImageMagik’s default PDF rights from “none” to “read|write” in /etc/ImageMagick-6/policy.xml
for
<policy domain="coder" rights="none" pattern="PDF" />
. Thanks for those details, too.
Merging PDFs isn’t straightforward even in Preview.app (macos)[0], so it’s great to know tools I already have will do what I need.
By default, convert
stripped most meta from source files. Explicit tags and values for PDF and XMP meta were not present in my outputfile.pdf
. This and the policy defaults are sane decisions. I added meta to the outputfile with exiftool and updated meta from sources to more closely match the new merged document. I have what I need for now and will explore options for keeping the meta from source files.
[0] Preview.app is my bar for quick crops, resizes, cuts&pastes, tagging and other enrichments. On Linux, I use Okular for many of these, but the workflows aren’t yet as quick and smooth for me as they are with Preview on macos.